import React, { Component } from 'react';
import './DateTime.less';
import zhCN from "rc-calendar/lib/locale/zh_CN";
import DatePicker from 'bee-datepicker';
import { Breadcrumb ,Button ,Table,Col, Row,Icon,Checkbox, Select  } from 'tinper-bee';
import moment from "moment";
import 'moment/locale/zh-cn';
moment.locale('zh-cn');



export default class DateTime extends Component {
    constructor(props) {
        super(props);
    }
    onSelect  = date => {
        this.props.saveTime(date)
    };
    onChange = (d) => {
    }
    render() {
        let  { placeholder, value } = this.props;
        console.log(value);
        value = value?moment(value):value;
        return (
            <div>
                <DatePicker
                    style={{top:"37px"}}
                      format={"YYYY-MM-DD"}
                      value={value}
                      onSelect={this.onSelect}
                      locale={zhCN}
                      placeholder = { placeholder ? placeholder : '年/月/日'}
                      autofocus={false}
                      onChange={this.onChange}
                />
            </div>
        );
    }
}